home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / processo.tar / processor.2 < prev    next >
Text File  |  1990-02-26  |  34KB  |  1,425 lines

  1.  
  2.         HP28S PROCESSOR INSTRUCTION SET           Version 1
  3.  
  4.                   Copyright (C) 1989, Alonzo Gariepy
  5.  
  6. ================================================================
  7.  
  8.     ==============================
  9.     ==============================
  10.     ==                ==
  11.     ==  INSTRUCTIONS BY NUMBER  ==
  12.     ==                ==
  13.     ==============================
  14.     ==============================
  15.  
  16.  
  17. Here is a list of HP28 opcodes in numerical order.  While the
  18. separation lines help in navigation, their primary purpose is
  19. to delimit the scope of each set of substitution tables.
  20.  
  21. ________________________________________________________________
  22.  
  23. 00        RETSETXM
  24. 01        RET
  25. 02        RETSETC
  26. 03        RETCLRC
  27. 04        SETHEX
  28. 05        SETDEC
  29. 06        PUSH.A    C        ***
  30. 07        POP.A    C        ***
  31. 08        CLR.X    ST        ***
  32. 09        MOVE.X    ST,C        ***
  33. 0A        MOVE.X    C,ST        ***
  34. 0B        SWAP.X    C,ST        ***
  35. 0C        INC.1    P        ***
  36. 0D        DEC.1    P        ***
  37. ________________________________________________________________
  38.  
  39. 0Exy        AND.f    s,d
  40. 0Exz        OR.f    s,d
  41.  
  42.             x | f          y z | s d
  43.                -------         -----------
  44.             0 | P          0 8 | B A
  45.             1 | WP          1 9 | C B
  46.             2 | XS          2 A | A C
  47.             3 | X          3 B | C D
  48.             4 | S          4 C | A B
  49.             5 | M          5 D | B C
  50.             6 | B          6 E | C A
  51.             7 | W          7 F | D C
  52.             F | A
  53. ________________________________________________________________
  54.  
  55. 0F    RETI
  56. ________________________________________________________________
  57.  
  58. 10j        MOVE.W    A,Rn        ***
  59. 10k        MOVE.W    C,Rn        ***
  60. 11j        MOVE.W    Rn,A        ***
  61. 11k        MOVE.W    Rn,C        ***
  62. 12j        SWAP.W    A,Rn        ***
  63. 12k        SWAP.W    C,Rn        ***
  64.  
  65.             j k | Rn
  66.                ----------
  67.             0 8 | R0
  68.             1 9 | R1
  69.             2 A | R2
  70.             3 B | R3
  71.             4 C | R4
  72. ________________________________________________________________
  73.  
  74. 13w        MOVE.A    s,Dn        ***
  75. 13x        SWAP.A    s,Dn        ***
  76. 13y        MOVE.4    s,Dn
  77. 13z        SWAP.4    s,Dn
  78.  
  79.             w x y z | s Dn
  80.                ----------------
  81.             0 2 8 A | A D0
  82.             1 3 9 B | A D1
  83.             4 6 C E | C D0
  84.             5 7 D F | C D1
  85. ________________________________________________________________
  86.  
  87. 14x        MOVE.A    s,d
  88. 14y        MOVE.B    s,d
  89. 15xt        MOVE.f    s,d
  90. 15yi        MOVE.n    s,d        ; n = i + 1
  91.  
  92.             x y |  s   d         t | f
  93.                ---------------        -------
  94.             0 8 |  A  @D0         0 | P
  95.             1 9 |  A  @D1         1 | WP
  96.             2 A | @D0  A         2 | XS
  97.             3 B | @D1  A         3 | X
  98.             4 C |  C  @D0         4 | S
  99.             5 D |  C  @D1         5 | M
  100.             6 E | @D0  C         6 | B
  101.             7 F | @D1  C         7 | W
  102. ________________________________________________________________
  103.  
  104. 16x        ADD.A    x+1,D0        ***
  105. 17x        ADD.A    x+1,D1        ***
  106.  
  107. 18x        SUB.A    x+1,D0        ***
  108. 19xx        MOVE.2    xx,D0
  109. 1Axxxx        MOVE.4    xxxx,D0
  110. 1Bxxxxx     MOVE.5    xxxxx,D0
  111.  
  112. 1Cx        SUB.A    x+1,D1        ***
  113. 1Dxx        MOVE.2    xx,D1
  114. 1Exxxx        MOVE.4    xxxx,D1
  115. 1Fxxxxx     MOVE.5    xxxxx,D1
  116.  
  117. 2x        MOVE.1    x,P        ***
  118.  
  119. 3ix...x     MOVE.Pn x...x,C     ; n = i + 1
  120. ________________________________________________________________
  121.  
  122. 4xx        BRCS    PC+1+xx
  123.  
  124. 420        NOP3
  125.  
  126. 5xx        BRCC    PC+1+xx
  127.  
  128. 6xxx        JUMP.3    PC+1+xxx    ***
  129.  
  130. 6300        NOP4
  131. 64000        NOP5
  132.  
  133. 7xxx        CALL.3    PC+4+xxx    ***
  134. ________________________________________________________________
  135.  
  136. 800        OUT.S    C
  137. 801        OUT.X    C
  138. 802        IN.4    A        ***
  139. 803        IN.4    C        ***
  140.  
  141. 804        UNCNFG
  142. 805        CONFIG
  143. 806        MOVE.A    ID,C
  144. 807        SHUTDN
  145. 8080        INTON
  146. 80810        RSI
  147. 8082ix...x    MOVE.Pn  x...x,A    ; n = i + 1
  148. 8083        BUSCB
  149.  
  150. 8084x        CLRB    x,A
  151. 8085x        SETB    x,A
  152.  
  153. 8086xyy     BRBC    x,A,PC+5+yy
  154. 8087xyy     BRBS    x,A,PC+5+yy
  155.  
  156. 8088x        CLRB    x,C
  157. 8089x        SETB    x,C
  158.  
  159. 808Axyy     BRBC    x,C,PC+5+yy
  160. 808Bxyy     BRBS    x,C,PC+5+yy
  161.  
  162. 808C        JUMP.A    @A        ***
  163. 808C        MOVE.A    @A,PC        ***
  164. 808D        BUSCD
  165. 808E        JUMP.A    @C        ***
  166. 808E        MOVE.A    @C,PC        ***
  167.  
  168. 808F        INTOFF
  169.  
  170. 809        ADD.A    P+1,C
  171.  
  172. 80A        RESET
  173.  
  174. 80B        BUSCC
  175.  
  176. 80Cx        MOVE.1    P,C,x        ***
  177. 80Dx        MOVE.1    C,x,P        ***
  178.  
  179. 80E        SREQ
  180.  
  181. 80Fx        SWAP.1    P,C,x        ***
  182. ________________________________________________________________
  183.  
  184.  
  185. 81w        RLN.W    d
  186. 81x        RRN.W    d
  187. 818twi        ADD.f    i+1,d
  188. 818tyi        SUB.f    i+1,d
  189. 819tw        SRB.f    d
  190. 81At0j        MOVE.f    A,Rn
  191. 81At0k        MOVE.f    C,Rn
  192. 81At1j        MOVE.f    Rn,A
  193. 81At1k        MOVE.f    Rn,C
  194. 81At2j        SWAP.f    A,Rn
  195. 81At2k        SWAP.f    C,Rn
  196. 81z        SRB.W    d
  197.  
  198.             t | f       w x y z | d       j k | Rn
  199.                -------      -------------   ----------
  200.             0 | P       0 4 8 C | A       0 8 | R0
  201.             1 | WP       1 5 9 D | B       1 9 | R1
  202.             2 | XS       2 6 A E | C       2 A | R2
  203.             3 | X       3 7 B F | D       3 B | R3
  204.             4 | S               4 C | R4
  205.             5 | M
  206.             6 | B
  207.             7 | W
  208.             F | A
  209. ________________________________________________________________
  210.  
  211. 81B2        JUMP.A    A        ***
  212. 81B2        MOVE.A    A,PC        ***
  213. 81B3        JUMP.A    C        ***
  214. 81B3        MOVE.A    C,PC        ***
  215. 81B4        MOVE.A    PC,A        ***
  216. 81B5        MOVE.A    PC,C        ***
  217. 81B6        SWAP.A    A,PC        ***
  218. 81B7        SWAP.A    C,PC        ***
  219. ________________________________________________________________
  220.  
  221. 82x        CLRB    d*
  222. 83xyy        BRBC    d,PC+3+yy
  223.  
  224.             x | d
  225.                --------
  226.             1 | XM
  227.             2 | SB
  228.             4 | SR
  229.             8 | MP
  230. ________________________________________________________________
  231.  
  232. 84x        CLRB    x,ST
  233. 85x        SETB    x,ST
  234.  
  235. 86xyy        BRBC    x,ST,PC+3+yy
  236. 87xyy        BRBS    x,ST,PC+3+yy
  237.  
  238. 88xyy        BRNE.1    P,x,PC+3+yy    ***
  239. 89xyy        BREQ.1    P,x,PC+3+yy    ***
  240. ________________________________________________________________
  241.  
  242. ttuyy        BREQ.f    s,d,PC+3+yy
  243. ttvyy        BRNE.f    s,d,PC+3+yy
  244. ttwyy        BRZ.f    s,PC+3+yy
  245. ttxyy        BRNZ.f    s,PC+3+yy
  246. zzuyy        BRGT.f    s,d,PC+3+yy
  247. zzvyy        BRLT.f    s,d,PC+3+yy
  248. zzwyy        BRGE.f    s,d,PC+3+yy
  249. zzxyy        BRLE.f    s,d,PC+3+yy
  250.  
  251.             tt zz | f    u v w x | s d
  252.                -----------     ---------------
  253.             8A 8B | A    0 4 8 C | A B
  254.             90 98 | P    1 5 9 D | B C
  255.             91 99 | WP    2 6 A E | C A
  256.             92 9A | XS    3 7 B F | D C
  257.             93 9B | X
  258.             94 9C | S
  259.             95 9D | M
  260.             96 9E | B
  261.             97 9F | W
  262. ________________________________________________________________
  263.  
  264. 8Cxxxx        JUMP.4    PC+2+xxxx
  265. 8Dxxxxx     JUMP.A    xxxxx
  266. 8Exxxx        CALL.4    PC+6+xxxx
  267. 8Fxxxxx     CALL.A    xxxxx
  268. ________________________________________________________________
  269.  
  270. kkx        ADD.f    s,d
  271. kkw        DEC.f    d
  272. ppt        CLR.f    d
  273. ppz        MOVE.f    s,d
  274. ppw        SWAP.f    s,d
  275. qqy        SUB.f    s,d
  276. qqu        INC.f    d
  277. qqw        SUBN.f    s,d
  278. rrt        SLN.f    d
  279. rru        SRN.f    d
  280. rrv        NEG.f    d
  281. rrw        NOT.f    d
  282.  
  283.             kk pp qq rr | f      t u v w x y z | s d
  284.                -----------------    ---------------------
  285.             A0 A8 B0 B8 | P      0 4 8 C 0 0 4 | B A
  286.             A1 A9 B1 B9 | WP     1 5 9 D 1 1 5 | C B
  287.             A2 AA B2 BA | XS     2 6 A E 2 2 6 | A C
  288.             A3 AB B3 BB | X      3 7 B F 3 3 7 | C D
  289.             A4 AC B4 BC | S          4       | A A
  290.             A5 AD B5 BD | M          5       | B B
  291.             A6 AE B6 BE | B          6       | C C
  292.             A7 AF B7 BF | W          7       | D D
  293.             C  D  E  F  | A          8 8 8 | A B
  294.                              9 9 9 | B C
  295.                              A A A | C A
  296.                              B B B | D C
  297.  
  298. ================================================================
  299.  
  300.     ================================================
  301.     ================================================
  302.     ==                          ==
  303.     ==  INSTRUCTIONS WITH DEFAULT FIELD SUFFIXES  ==
  304.     ==                          ==
  305.     ================================================
  306.     ================================================
  307.  
  308.  
  309. Here is a summary of all instructions in which you may omit the
  310. field suffix after the name.  These instructions are marked with
  311. *** in the numeric and alphabetic listings.  This summary uses
  312. the following abbreviations:  ac = A or C;  Dn = D0 or D1;  Rn =
  313. R0, R1, R2, R3, or R4.    These are the only instructions in which
  314. you can omit the field suffix:
  315. ________________________________________________________________
  316.  
  317.   .A    Instructions that reference D0, D1, PC, or RSTK use
  318.     the Address Field by default when you omit the .A
  319.     suffix:
  320.  
  321.         PUSH    C
  322.         POP    C
  323.         MOVE    ac,Dn
  324.         SWAP    ac,Dn
  325.         ADD    const,Dn
  326.         SUB    const,Dn
  327.         JUMP    @ac
  328.         MOVE    @ac,PC
  329.         JUMP    ac
  330.         MOVE    ac,PC
  331.         MOVE    PC,ac
  332.         SWAP    ac,PC
  333. ________________________________________________________________
  334.  
  335.   .1    Instructions that reference P use a one nibble field by
  336.     default when you omit the .1 suffix:
  337.  
  338.         BREQ    P,x,PC+3+offset
  339.         BRNE    P,x,PC+3+offset
  340.         DEC    P
  341.         INC    P
  342.         MOVE    x,P
  343.         MOVE    P,C,i
  344.         MOVE    C,i,P
  345.         RETEQ    P,x
  346.         RETNE    P,x
  347.         SWAP    P,C,i
  348. ________________________________________________________________
  349.  
  350.   .W    Instructions that reference the temporary registers use
  351.     the entire word by default when you omit the .W suffix:
  352.  
  353.         MOVE    ac,Rn
  354.         MOVE    Rn,ac
  355.         SWAP    ac,Rn
  356. ________________________________________________________________
  357.  
  358.   .3    You can omit the .3 suffix from relative JUMP and CALL
  359.     instructions that use three nibble offsets:
  360.  
  361.         JUMP    PC+1+offset
  362.         CALL    PC+4+offset
  363. ________________________________________________________________
  364.  
  365.   .X    Instructions that reference ST use a three nibble field
  366.     by default so you can omit the .X suffix:
  367.  
  368.         CLR    ST
  369.         MOVE    C,ST
  370.         MOVE    ST,C
  371.         SWAP    C,ST
  372. ________________________________________________________________
  373.  
  374.   .4    The IN instruction only uses a four nibble field so you
  375.     can omit the .4 suffix:
  376.  
  377.         IN    ac
  378. ________________________________________________________________
  379.  
  380. Here is a list of all the instructions that never take a suffix:
  381.  
  382.      BRBC     BUSCD         NOP4     RETCC         SETB
  383.      BRBS     CLRB         NOP5     RETCLRC     SETDEC
  384.      BRCC     CONFIG      RESET     RETCS         SETHEX
  385.      BRCS     INTOFF      RET     RETSETC     SHUTDN
  386.      BUSCB     INTON         RETBC     RETSETXM    SREQ
  387.      BUSCC     NOP3         RETBS     RSI         UNCNFG
  388. ________________________________________________________________
  389.  
  390.  
  391.     ALL OTHER INSTRUCTIONS REQUIRE A FIELD SUFFIX.
  392.  
  393.     The following instructions are similar to ones above
  394.     but do require a field suffix:
  395.  
  396.         ADD.A    P+1,C
  397.         OUT.S    C
  398.         OUT.X    C
  399.         MOVE.2    const,Dn
  400.         MOVE.4    const,Dn
  401.         MOVE.5    const,Dn
  402.         MOVE.4    ac,Dn
  403.         JUMP.4    PC+2+offset
  404.         CALL.4    PC+2+offset
  405.         CALL.A    const
  406.  
  407. ================================================================
  408.  
  409.     ============================
  410.     ============================
  411.     ==              ==
  412.     ==  INSTRUCTIONS BY TYPE  ==
  413.     ==              ==
  414.     ============================
  415.     ============================
  416.  
  417.  
  418. ================================================================
  419.         ADD
  420. ================================================================
  421.  
  422. ADD Register to Register
  423.  
  424.         kkx    ADD.f    s,d
  425.  
  426.                      kk | f       x | s d
  427.                     --------     ---------
  428.                      A0 | P       0 | B A
  429.                      A1 | WP      1 | C B
  430.                      A2 | XS      2 | A C
  431.                      A3 | X       3 | C D
  432.                      A4 | S       4 | A A
  433.                      A5 | M       5 | B B
  434.                      A6 | B       6 | C C
  435.                      A7 | W       7 | D D
  436.                      C  | A       8 | A B
  437.                               9 | B C
  438.                               A | C A
  439.                               B | D C
  440. Examples:
  441.  
  442. C8    ADD.A    A,B        ; B = B + A  (20 bits)
  443. A70    ADD.W    B,A        ; A = A + B  (64 bits)
  444. A36    ADD.X    C,C        ; C = C + C  (12 bits)
  445. ________________________________________________________________
  446.  
  447. ADD Constant to Register
  448.  
  449.     "The 818... opcodes don't always work as advertised.
  450.     To be specific, when the field of such an instruction
  451.     is XS, S, P, or WP, and a carry (or borrow) is generated
  452.     out of the most significant nibble, it wraps around and
  453.     affects the least significant nibble." -- D.K.
  454.  
  455.  
  456.         818twi    ADD.f    i+1,d
  457.  
  458.                      t | f       x | d
  459.                     -------   -------
  460.                      0 | P       0 | A
  461.                      1 | WP    1 | B
  462.                      2 | XS    2 | C
  463.                      3 | X       3 | D
  464.                      4 | S
  465.                      5 | M
  466.                      6 | B
  467.                      7 | W
  468.                      F | A
  469. Examples:
  470.  
  471. 818718    ADD.W    9,B        ; B = B + 9    (64 bits)
  472. 81860F    ADD.B    16,A        ; A = A + 16     (8 bits)
  473. ________________________________________________________________
  474.  
  475. ADD Constant to Address Register
  476.  
  477.     These instructions let you add a constant from 1 to 16
  478.     to the contents of registers D0 or D1.
  479.  
  480.         16x    ADD.A    x+1,D0        ***
  481.         17x    ADD.A    x+1,D1        ***
  482.  
  483. Examples:
  484.  
  485. 164    ADD    5,D0        ; D0 = D0 + 5  (20 bits)
  486. 17E    ADD    15,D1        ; D1 = D1 + 15 (20 bits)
  487. ________________________________________________________________
  488.  
  489. ADD Pointer+1 to Register
  490.  
  491.         809    ADD.A    P+1,C
  492. Examples:
  493.  
  494. 809    ADD.A    P+1,C        ; C = C + P + 1   (20 bits)
  495.  
  496.  
  497. ================================================================
  498.         AND
  499. ================================================================
  500.  
  501. AND Register to Register
  502.  
  503.         0Exy    AND.f    s,d
  504.  
  505.                      x | f          y | s d
  506.                     -------      ---------
  507.                      0 | P          0 | B A
  508.                      1 | WP       1 | C B
  509.                      2 | XS       2 | A C
  510.                      3 | X          3 | C D
  511.                      4 | S          4 | A B
  512.                      5 | M          5 | B C
  513.                      6 | B          6 | C A
  514.                      7 | W          7 | D C
  515.                      F | A
  516. Examples:
  517.  
  518. 0E63    AND.B    C,D        ; D = D & C   (8 bits)
  519. 0EF5    AND.A    B,C        ; C = C & B  (20 bits)
  520.  
  521. ================================================================
  522.         BRANCH and RETURN
  523. ================================================================
  524.  
  525. These instructions branch or return when an associated test
  526. evaluates true.  The destination of the branch is the sum of
  527. an 8 bit sign extended 2's complement offset and the address
  528. of that offset.  When the offset is 00, the destination is
  529. reached by popping an address off the return stack.
  530.  
  531. In the following, the destination argument is expressed relative
  532. to the address of the instruction (designated PC).  In the case
  533. of a return, this argument can be omitted and the BR in the
  534. mnemonic substituted with RET.
  535. ________________________________________________________________
  536.  
  537. Branch/Return Bit Clear
  538. Branch/Return Bit Set
  539.  
  540.     These instructions branch/return depending on whether the
  541.     specified bit in a register is 0 or 1.
  542.  
  543.         8086xyy BRBC    x,A,PC+5+yy
  544.         808Axyy BRBC    x,C,PC+5+yy
  545.         83zyy    BRBC    hf,PC+3+yy
  546.         86xyy    BRBC    x,ST,PC+3+yy
  547.         8087xyy BRBS    x,A,PC+5+yy
  548.         808Bxyy BRBS    x,C,PC+5+yy
  549.         87xyy    BRBS    x,ST,PC+3+yy
  550.  
  551.                          z | hf
  552.                         --------
  553.                          1 | XM
  554.                          2 | SB
  555.                          4 | SR
  556.                          8 | MP
  557. Examples:
  558.  
  559. 808B900 RETBS    9,C        ; return if bit 9 of C is set
  560. 8765F    BRBS    6,ST,PC-8    ; jump 8 nibbles before instruction
  561.                 ;      if bit 6 of ST is set
  562. 8086E02 BRBC    14,A,PC+37    ; jump 37 nibbles from instruction
  563.                 ;      if bit 14 of A is clear
  564. 83400    RETC    SR        ; return if Service Request clear
  565. 8380F    BRBC    MP,PC-13    ; jump -13 if Module Pulled clear
  566. ________________________________________________________________
  567.  
  568. Branch/Return Carry Clear
  569. Branch/Return Carry Set
  570.  
  571.     These instructions branch/return depending on whether the
  572.     carry flag is clear or set.
  573.  
  574.         5xx    BRCC    PC+1+xx
  575.         4xx    BRCS    PC+1+xx
  576. Examples:
  577.  
  578. 500    RETCC            ; return if carry clear
  579. 45F    BRCS    PC-10        ; branch -10 nibbles if carry set
  580. 550    BRCC    PC+6        ; branch +6 nibbles if carry clear
  581. ________________________________________________________________
  582.  
  583. Branch/Return Pointer Equal
  584. Branch/Return Pointer Not Equal
  585.  
  586.     These instructions branch/return depending on whether the
  587.     4 bit register P is equal/not equal to a 4 bit constant.
  588.  
  589.         89xyy    BREQ.1    P,x,PC+3+yy    ***
  590.         88xyy    BRNE.1    P,x,PC+3+yy    ***
  591. Examples:
  592.  
  593. 89C31    BREQ    P,12,PC+22    ; branch +22 if P equals 12
  594. 88500    RETNE    P,5        ; return if P not equal to 5
  595. ________________________________________________________________
  596.  
  597. Branch/Return Register Inequality
  598.  
  599.     These instructions branch/return depending on the result
  600.     of an inequality between the fields of two registers.
  601.  
  602.         ttuyy    BREQ.f    s,d,PC+3+yy
  603.         ttvyy    BRNE.f    s,d,PC+3+yy
  604.         ttwyy    BRZ.f    s,PC+3+yy
  605.         ttxyy    BRNZ.f    s,PC+3+yy
  606.         zzuyy    BRGT.f    s,d,PC+3+yy
  607.         zzvyy    BRLT.f    s,d,PC+3+yy
  608.         zzwyy    BRGE.f    s,d,PC+3+yy
  609.         zzxyy    BRLE.f    s,d,PC+3+yy
  610.  
  611.                      tt zz | f     u v w x | s d
  612.                     -----------   ---------------
  613.                      8A 8B | A     0 4 8 C | A B
  614.                      90 98 | P     1 5 9 D | B C
  615.                      91 99 | WP    2 6 A E | C A
  616.                      92 9A | XS    3 7 B F | D C
  617.                      93 9B | X
  618.                      94 9C | S
  619.                      95 9D | M
  620.                      96 9E | B
  621.                      97 9F | W
  622. Examples:
  623.  
  624. 8B500    RETLT.A B,C        ; return if B < C       (20 bits)
  625. 93BD0    BRZ.X    D,PC+16     ; branch +16 if D is zero  (12 bits)
  626. 9FA00    RETGE.W C,A        ; return if C >= A       (64 bits)
  627.  
  628. ================================================================
  629.         BUS COMMANDS
  630. ================================================================
  631.  
  632.         8083    BUSCB
  633.         80B    BUSCC
  634.         808D    BUSCD
  635.         804    UNCNFG        ; unconfig all chips
  636.         805    CONFIG        ; config next chip
  637.         806    MOVE.A    ID,C    ; get ID of current chip
  638.         807    SHUTDN        ; shutdown bus, stop cpu
  639.         80A    RESET        ; bus reset, resets chips
  640.         80E    SREQ        ; check for service request
  641.  
  642. ================================================================
  643.         CALL
  644. ================================================================
  645.  
  646. Call Subroutine Relative
  647.  
  648.     Unlike the BR and relative JUMP commands, relative CALLs
  649.     contain an offset from the next instruction.  In the
  650.     following these are expressed relative to the address of
  651.     the CALL instruction itself (PC).  Offsets are in stored
  652.     in 2's complement form.
  653.  
  654.         7xxx    CALL.3    PC+4+xxx    ***
  655.         8Exxxx    CALL.4    PC+6+xxxx
  656. Examples:
  657.  
  658. 7040    CALL    PC+68        ; call 68 nibbles from this instruction
  659. 8E020E    CALL.4    PC-8154     ; call 8154 nibbles back from insruction
  660. ________________________________________________________________
  661.  
  662. Call Subroutine Absolute
  663.  
  664.         8Fxxxxx CALL.A    xxxxx
  665. Examples:
  666.  
  667. 8F0200C CALL.A    #C0020        ; call to absolute address #C0020h
  668.  
  669.  
  670. ================================================================
  671.         CLEAR
  672. ================================================================
  673.  
  674. Clear Field of Register
  675.  
  676.         ppt    CLR.f    d
  677.  
  678.                      pp | f        t| d
  679.                     --------      ------
  680.                      A8 | P        0| A
  681.                      A9 | WP       1| B
  682.                      AA | XS       2| C
  683.                      AB | X        3| D
  684.                      AC | S
  685.                      AD | M
  686.                      AE | B
  687.                      AF | W
  688.                      D  | A
  689. Examples:
  690.  
  691. D2    CLR.A    C        ; clear address field of C (20 bits)
  692. A83    CLR.P    D        ; clear nibble of D pointed to by P
  693. AF0    CLR.W    A        ; clear all of A           (64 bits)
  694. ________________________________________________________________
  695.  
  696. Clear Bit
  697.  
  698.         8084x    CLRB    x,A
  699.         8088x    CLRB    x,C
  700.         84x    CLRB    x,ST
  701. Examples:
  702.  
  703. 8084D    CLRB    13,A        ; clear bit 13 of register A
  704. 80880    CLRB    0,C        ; clear bit 0 of register C
  705. 847    CLRB    7,ST        ; clear bit 7 of ST
  706. ________________________________________________________________
  707.  
  708. Clear Hardware Status Flag(s)
  709.  
  710.     The bits 1,2,4, and 8 can be ORed together to clear
  711.     more than one hardware status flag at a time.
  712.  
  713.         82x    CLRB    d*
  714.  
  715.                      x | d
  716.                     --------
  717.                      1 | XM
  718.                      2 | SB
  719.                      4 | SR
  720.                      8 | MP
  721. Examples:
  722.  
  723. 825    CLR    XM,SR
  724. 822    CLR    SB
  725. ________________________________________________________________
  726.  
  727. Clear Bits 0-11 of ST
  728.  
  729.         08    CLR.X    ST        ***
  730.  
  731. ================================================================
  732.         DECREMENT
  733. ================================================================
  734.  
  735. Decrement register one unit.  Adjust carry.
  736.  
  737.         0D    DEC.1    P        ***
  738.         kkw    DEC.f    d
  739.  
  740.                      kk | f        w | d
  741.                     --------      -------
  742.                      A0 | P        C | A
  743.                      A1 | WP       D | B
  744.                      A2 | XS       E | C
  745.                      A3 | X        F | D
  746.                      A4 | S
  747.                      A5 | M
  748.                      A6 | B
  749.                      A7 | W
  750.                      C  | A
  751. Examples:
  752.  
  753. 0D    DEC    P        ; P = P - 1   (4 bits)
  754. A3D    DEC.X    B        ; B = B - 1  (12 bits)
  755.  
  756. ================================================================
  757.         IN
  758. ================================================================
  759.  
  760. Copy IN register to register A or C
  761.  
  762.         802    IN.4    A        ***
  763.         803    IN.4    C        ***
  764.  
  765. ================================================================
  766.         INCREMENT
  767. ================================================================
  768.  
  769. Increment register one unit.  Adjust carry.
  770.  
  771.         0C    INC.1    P        ***
  772.         qqu    INC.f    d
  773.  
  774.                      qq | f      u | d
  775.                     --------    -------
  776.                      B0 | P      4 | A
  777.                      B1 | WP     5 | B
  778.                      B2 | XS     6 | C
  779.                      B3 | X      7 | D
  780.                      B4 | S
  781.                      B5 | M
  782.                      B6 | B
  783.                      B7 | W
  784.                      E  | A
  785. Examples:
  786.  
  787. 0C    INC    P        ; P = P - 1    (4 bits)
  788. B77    INC.W    D        ; D = D - 1   (64 bits)
  789.  
  790. ================================================================
  791.         INTERRUPT COMMANDS
  792. ================================================================
  793.  
  794.         808F    INTOFF
  795.         8080    INTON
  796.         80810    RSI
  797.  
  798. ================================================================
  799.         JUMP
  800. ================================================================
  801.  
  802. JUMP Relative
  803.  
  804.     The JUMP command takes a 2's complement offset relative
  805.     to the address of the offset, stored with the least
  806.     signficant bit first.  In the following, the destination
  807.     is expressed relative to the address of the JUMP instruction.
  808.  
  809.         6xxx    JUMP.3    PC+1+xxx    ***
  810.         8Cxxxx    JUMP.4    PC+2+xxxx
  811. Examples:
  812.  
  813. 6C10    JUMP    PC+29
  814. 6C1F    JUMP    PC-227
  815. 8C1001    JUMP.4    PC+4099
  816. ________________________________________________________________
  817.  
  818. Jump Absolute
  819.  
  820.         8Dxxxxx JUMP.A    xxxxx
  821. ________________________________________________________________
  822.  
  823. Jump Register Indirect
  824.  
  825.     These opcodes are useful for implementing the threaded
  826.     RPL interpreter of the HP28S.  They can be expressed
  827.     either as MOVE or JUMP instructions.  The effect is to
  828.     set the PC to the address pointed at by the address
  829.     pointed at by the register.
  830.  
  831.         808C    JUMP.A    @A        ***
  832.         808C    MOVE.A    @A,PC        ***
  833.         808E    JUMP.A    @C        ***
  834.         808E    MOVE.A    @C,PC        ***
  835. ________________________________________________________________
  836.  
  837. Jump Register Direct
  838.  
  839.     Opcodes 81B2 and 81B3 can be expressed either as MOVE
  840.     or JUMP instructions.  The SWAP instructions might be
  841.     useful for implementing coroutines.
  842.  
  843.         81B2    JUMP.A    A        ***
  844.         81B2    MOVE.A    A,PC        ***
  845.         81B3    JUMP.A    C        ***
  846.         81B3    MOVE.A    C,PC        ***
  847.         81B6    SWAP.A    A,PC        ***
  848.         81B7    SWAP.A    C,PC        ***
  849.  
  850. ================================================================
  851.         MOVE
  852. ================================================================
  853.  
  854. There are so many MOVE instructions that it might make sense to
  855. distinguish them with their own names, but there is also virtue
  856. in limiting the number of mnemonics one must remember.
  857. ________________________________________________________________
  858.  
  859. MOVE Register to Register
  860.  
  861.         ppz    MOVE.f s,d
  862.  
  863.                      pp | f      z | s d
  864.                     --------    ---------
  865.                      A8 | P      4 | B A
  866.                      A9 | WP     5 | C B
  867.                      AA | XS     6 | A C
  868.                      AB | X      7 | C D
  869.                      AC | S      8 | A B
  870.                      AD | M      9 | B C
  871.                      AE | B      A | C A
  872.                      AF | W      B | D C
  873.                      D  | A
  874. Examples:
  875.  
  876. D9    MOVE.A    B,C        ; C gets B    (20 bits)
  877. AE4    MOVE.B    B,A        ; A gets B     (8 bits)
  878. AFB    MOVE.W    D,C        ; C gets D    (64 bits)
  879. ________________________________________________________________
  880.  
  881. MOVE Memory to Register
  882. MOVE Register to Memory
  883.  
  884.     These instructions move between memory and registers A
  885.     or C by indirecting through address registers D0 or D1.
  886.  
  887.  
  888.         14x    MOVE.A    s,d
  889.         14y    MOVE.B    s,d
  890.         15xt    MOVE.f    s,d
  891.         15yi    MOVE.n    s,d    ; n = i + 1
  892.  
  893.                      x y |    s   d      t | f
  894.                     --------------     -------
  895.                      0 8 |    A  @D0      0 | P
  896.                      1 9 |    A  @D1      1 | WP
  897.                      2 A | @D0  A      2 | XS
  898.                      3 B | @D1  A      3 | X
  899.                      4 C |    C  @D0      4 | S
  900.                      5 D |    C  @D1      5 | M
  901.                      6 E | @D0  C      6 | B
  902.                      7 F | @D1  C      7 | W
  903. Examples:
  904.  
  905. 142    MOVE.A    @D0,A        ; A gets 20 bits stored at D0
  906. 15D6    MOVE.7    C,@D1        ; Store 28 bits of C at D1
  907. 1577    MOVE.W    @D1,C        ; C gets 64 bits stored at D1
  908.  
  909. 149    MOVE.B    A,@D1        ; Store one byte of A at D1
  910. 1516    MOVE.B    A,@D1        ; Store one byte of A at D1
  911. 1591    MOVE.2    A,@D1        ; Store one byte of A at D1
  912. ________________________________________________________________
  913.  
  914. MOVE Register to Address Register
  915.  
  916.         13w    MOVE.A    s,Da        ***
  917.         13y    MOVE.4    s,Da
  918.  
  919.                      w y | s Da
  920.                     -----------
  921.                      0 8 | A D0
  922.                      1 9 | A D1
  923.                      4 C | C D0
  924.                      5 D | C D1
  925. Examples:
  926.  
  927. 131    MOVE    A,D1        ; D1 gets A    (20 bits)
  928. 13C    MOVE.4    C,D0        ; D0 gets C    (16 bits)
  929. ________________________________________________________________
  930.  
  931. MOVE Register to Temporary Register
  932. MOVE Temporary Register to Register
  933.  
  934.         10j    MOVE.W    A,Rn        ***
  935.         10k    MOVE.W    C,Rn        ***
  936.         11j    MOVE.W    Rn,A        ***
  937.         11k    MOVE.W    Rn,C        ***
  938.  
  939. 81At0j        MOVE.f    A,Rn
  940. 81At0k        MOVE.f    C,Rn
  941. 81At1j        MOVE.f    Rn,A
  942. 81At1k        MOVE.f    Rn,C
  943. 81At2j        SWAP.f    A,Rn
  944. 81At2k        SWAP.f    C,Rn
  945.  
  946.  t | f         j k | Rn
  947. -------       ----------
  948.  0 | P         0 8 | R0
  949.  1 | WP        1 9 | R1
  950.  2 | XS        2 A | R2
  951.  3 | X         3 B | R3
  952.  4 | S         4 C | R4
  953.  5 | M
  954.  6 | B
  955.  7 | W
  956.  F | A
  957.  
  958. Examples:
  959.  
  960. 100    MOVE    A,R0        ; R0 gets A    (64 bits)
  961. 11C    MOVE    R4,C        ; C gets R4    (64 bits)
  962. 81A71C    MOVE.W    R4,C        ; C gets R4    (64 bits)
  963. 81A309    MOVE.X    C,R1        ; R1 gets C    (12 bits)
  964. ________________________________________________________________
  965.  
  966. MOVE Register to PC
  967. MOVE PC to Register
  968.  
  969.     Opcodes 81B2 and 81B3 can be expressed either as MOVE
  970.     or JUMP instructions.
  971.  
  972.         81B2    MOVE.A    A,PC        ***
  973.         81B3    MOVE.A    C,PC        ***
  974.         81B4    MOVE.A    PC,A        ***
  975.         81B5    MOVE.A    PC,C        ***
  976. ________________________________________________________________
  977.  
  978. MOVE Register Indirect to PC
  979.  
  980.     These opcodes are useful for implementing the threaded
  981.     RPL interpreter of the HP28S.  They can be expressed
  982.     either as MOVE or JUMP instructions.  The effect is to
  983.     set the PC to the address pointed at by the address
  984.     pointed at by the register.
  985.  
  986.         808C    MOVE.A    @A,PC        ***
  987.         808E    MOVE.A    @C,PC        ***
  988. ________________________________________________________________
  989.  
  990. MOVE Constant to Register
  991.  
  992.     These instructions move a variable length constant from
  993.     the instruction stream into registers A or C beginning
  994.     with the nibble pointed to by register P.  This results
  995.     in a unique field type, Pn, where P designates the position
  996.     where the constant will be moved and n the size of the
  997.     constant in nibbles.
  998.  
  999.         3ix...x     MOVE.Pn  x...x,C    ; n = i + 1
  1000.         8082ix...x  MOVE.Pn  x...x,A    ; n = i + 1
  1001. Examples:
  1002.  
  1003. 34910C0      MOVE.P5    #C019,C
  1004. 32310         MOVE.P3    19,C
  1005. 808234000    MOVE.P4    4,A
  1006. ________________________________________________________________
  1007.  
  1008. MOVE Constant to Address Register
  1009.  
  1010.         19xx    MOVE.2 xx,D0
  1011.         1Axxxx    MOVE.4 xxxx,D0
  1012.         1Bxxxxx MOVE.5 xxxxx,D0
  1013.         1Dxx    MOVE.2 xx,D1
  1014.         1Exxxx    MOVE.4 xxxx,D1
  1015.         1Fxxxxx MOVE.5 xxxxx,D1
  1016. Examples:
  1017.  
  1018. 1940    MOVE.2    4,D0        ; D0 gets 4         (8 bits)
  1019. 1E1234    MOVE.4    #4321,D1    ; D1 get #4321h     (16 bits)
  1020. 1B12340 MOVE.5    #4321,D0    ; D0 gets #04321h   (20 bits)
  1021. ________________________________________________________________
  1022.  
  1023. MOVE Constant to Pointer Register
  1024.  
  1025.         2x    MOVE.1    x,P        ***
  1026. Examples:
  1027.  
  1028. 27    MOVE    7,P        ; P points to nibble 7
  1029. 2C    MOVE    12,P        ; P points to nibble 12
  1030. ________________________________________________________________
  1031.  
  1032. MOVE Pointer Register to Register Nibble
  1033. MOVE Register Nibble to Pointer Register
  1034.  
  1035.     Move 4 bit P register value to or from the specified
  1036.     nibble (x) of regiester C.
  1037.  
  1038.         80Cx    MOVE.1    P,C,x        ***
  1039.         80Dx    MOVE.1    C,x,P        ***
  1040. Examples:
  1041.  
  1042. 80C0    MOVE    P,C,0    ; nibble 0 of C gets P    (4 bits)
  1043. 80D7    MOVE    C,7,P    ; P gets nibble 7 of C    (4 bits)
  1044. ________________________________________________________________
  1045.  
  1046. MOVE Register to Status Register
  1047. MOVE Status Register to Register
  1048.  
  1049.         09    MOVE.X    ST,C        ***
  1050.         0A    MOVE.X    C,ST        ***
  1051.  
  1052. ================================================================
  1053.         NEGATE
  1054. ================================================================
  1055.  
  1056. Negate Register (2's complement)
  1057.  
  1058.         rrv    NEG.f    d
  1059.  
  1060.                      rr | f      v | d
  1061.                     --------    -------
  1062.                      B8 | P      8 | A
  1063.                      B9 | WP     9 | B
  1064.                      BA | XS     A | C
  1065.                      BB | X      B | D
  1066.                      BC | S
  1067.                      BD | M
  1068.                      BE | B
  1069.                      BF | W
  1070.                      F  | A
  1071. Examples:
  1072.  
  1073. FA    NEG.A    C        ; C = -C    (20 bits)
  1074. BEB    NEG.B    D        ; D = -D     (8 bits)
  1075.  
  1076. ================================================================
  1077.         NO OPERATION
  1078. ================================================================
  1079.  
  1080. NOP
  1081.     These instructions do nothing.
  1082.  
  1083.         420    NOP3
  1084.         6300    NOP4
  1085.         64000    NOP5
  1086.  
  1087. ================================================================
  1088.         NOT
  1089. ================================================================
  1090.  
  1091. Invert Register (1's complement)
  1092.  
  1093.         rrw    NOT.f    d
  1094.  
  1095.                      rr | f       w | d
  1096.                     --------     -------
  1097.                      B8 | P       C | A
  1098.                      B9 | WP      D | B
  1099.                      BA | XS      E | C
  1100.                      BB | X       F | D
  1101.                      BC | S
  1102.                      BD | M
  1103.                      BE | B
  1104.                      BF | W
  1105.                      F  | A
  1106. Examples:
  1107.  
  1108. BCE    NOT.S    C    ; invert nibble 15 of C  (4 bits)
  1109. FF    NOT.A    D    ; invert D        (20 bits)
  1110.  
  1111. ================================================================
  1112.         OR
  1113. ================================================================
  1114.  
  1115. OR Register to Register
  1116.  
  1117.         0Exz    OR.f    s,d
  1118.  
  1119.                      x | f          z | s d
  1120.                     -------      ---------
  1121.                      0 | P          8 | B A
  1122.                      1 | WP       9 | C B
  1123.                      2 | XS       A | A C
  1124.                      3 | X          B | C D
  1125.                      4 | S          C | A B
  1126.                      5 | M          D | B C
  1127.                      6 | B          E | C A
  1128.                      7 | W          F | D C
  1129.                      F | A
  1130. Examples:
  1131.  
  1132. 0E6C    OR.B    A,B        ; B = B & A   (8 bits)
  1133. 0EFF    OR.A    D,C        ; C = C & D  (20 bits)
  1134.  
  1135. ================================================================
  1136.         OUT
  1137. ================================================================
  1138.  
  1139. Copy OUT register to register A or C
  1140.  
  1141.         800    OUT.S    C
  1142.         801    OUT.X    C
  1143.  
  1144. ================================================================
  1145.         POP
  1146. ================================================================
  1147.  
  1148. POP Address from Stack
  1149.  
  1150.         07    POP.A    C        ***
  1151.  
  1152. ================================================================
  1153.         PUSH
  1154. ================================================================
  1155.  
  1156. PUSH Address onto Stack
  1157.  
  1158.         06    PUSH.A    C        ***
  1159.  
  1160. ================================================================
  1161.         RETURN
  1162. ================================================================
  1163.  
  1164. Return from Subroutine, popping return address from stack
  1165.  
  1166.         01    RET        ; return
  1167.         02    RETSETC     ; set carry and return
  1168.         03    RETCLRC     ; clear carry and return
  1169.         0F    RETI        ; enable int and return
  1170.         00    RETSETXM    ; set XM flag and return
  1171. ________________________________________________________________
  1172.  
  1173. Conditional Return
  1174.  
  1175.     See BRANCH.  Branch instructions function as conditional
  1176.     returns when their destination offset is zero.
  1177.  
  1178. ================================================================
  1179.         ROTATE
  1180. ================================================================
  1181.  
  1182. Rotate Left nibble
  1183. Rotate Right nibble
  1184.  
  1185.     The SB flag is set when a non-zero nibble is shifted
  1186.     from postion 0 to 15 (RRN only).
  1187.  
  1188.         81w    RLN.W    d
  1189.         81x    RRN.W    d
  1190.  
  1191.                      w x | d
  1192.                     ---------
  1193.                      0 4 | A
  1194.                      1 5 | B
  1195.                      2 6 | C
  1196.                      3 7 | D
  1197. Examples:
  1198.  
  1199. 810    RLN.W    A    ; rotate A one nibble left
  1200. 816    RRN.W    C    ; rotate C one nibble right
  1201.  
  1202. ================================================================
  1203.         SET
  1204. ================================================================
  1205.  
  1206. Set Bit
  1207.  
  1208.         8085x    SETB    x,A
  1209.         8089x    SETB    x,C
  1210.         85x    SETB    x,ST
  1211. Examples:
  1212.  
  1213. 8085D    SETB    13,A        ; clear bit 13 of register A
  1214. 80890    SETB    0,C        ; clear bit 0 of register C
  1215. 857    SETB    7,ST        ; clear bit 7 of ST
  1216. ________________________________________________________________
  1217.  
  1218. Set Decimal
  1219. Set Hexadecimal
  1220.  
  1221.     Sets the CPU to do register arithmetic in HEX (binary) or
  1222.     DEC (binary coded decimal) mode.
  1223.  
  1224.         05    SETDEC
  1225.         04    SETHEX
  1226.  
  1227. ================================================================
  1228.         SHIFT
  1229. ================================================================
  1230.  
  1231. Shift Left nibble
  1232. Shift Right nibble
  1233. Shift Right Bit
  1234.  
  1235.     The SB flag is set when a non-zero nibble/bit is shifted
  1236.     out of position 0 (SRN/SRB only).  Zeros shifted in.
  1237.  
  1238.         rrw    SLN.f    d
  1239.         rrx    SRN.f    d
  1240.         819tw    SRB.f    d
  1241.         81z    SRB.W    d
  1242.  
  1243.                     rr t | f      w x z | d
  1244.                        -----------   -----------
  1245.                     B8 0 | P      0 4 C | A
  1246.                     B9 1 | WP     1 5 D | B
  1247.                     BA 2 | XS     2 6 E | C
  1248.                     BB 3 | X      3 7 F | D
  1249.                     BC 4 | S
  1250.                     BD 5 | M
  1251.                     BE 6 | B
  1252.                     BF 7 | W
  1253.                     F  F | A
  1254. Examples:
  1255.  
  1256. F3    SLN.A    D    ; shift D left one nibble    (20 bits)
  1257. BE6    SRN.B    C    ; shift C right one nibble    (8 bits)
  1258. 81931    SRB.X    B    ; shift B right one bit      (12 bits)
  1259.  
  1260. ================================================================
  1261.         SUB
  1262. ================================================================
  1263.  
  1264. Subtract Register from Register
  1265.  
  1266.     The SUBN instruction stores the negative of the
  1267.     subtraction in the destination.
  1268.  
  1269.         qqy    SUB.f    s,d
  1270.         qqw    SUBN.f    s,d
  1271.  
  1272.                     qq | f         y w | s d
  1273.                        --------     -----------
  1274.                     B0 | P         0 C | B A
  1275.                     B1 | WP      1 D | C B
  1276.                     B2 | XS      2 E | A C
  1277.                     B3 | X         3 F | C D
  1278.                     B4 | S         8     | A B
  1279.                     B5 | M         9     | B C
  1280.                     B6 | B         A     | C A
  1281.                     B7 | W         B     | D C
  1282.                     E  | A
  1283. Examples:
  1284.  
  1285. E2    SUB.A    A,C    ; C = C - A          (20 bits)
  1286. EE    SUBN.A    A,C    ; C = - (C - A) = A - C   (20 bits)
  1287. B70    SUB.W    B,A    ; A = A - B          (64 bits)
  1288. ________________________________________________________________
  1289.  
  1290. Subtract Constant from Register
  1291.  
  1292.     "The 818... opcodes don't always work as advertised.
  1293.     To be specific, when the field of such an instruction
  1294.     is XS, S, P, or WP, and a carry (or borrow) is generated
  1295.     out of the most significant nibble, it wraps around and
  1296.     affects the least significant nibble." -- D.K.
  1297.  
  1298.         818tyi    SUB.f    i+1,d
  1299.  
  1300.                      t | f       y | d
  1301.                     -------   -------
  1302.                      0 | P       8 | A
  1303.                      1 | WP    9 | B
  1304.                      2 | XS    A | C
  1305.                      3 | X       B | D
  1306.                      4 | S
  1307.                      5 | M
  1308.                      6 | B
  1309.                      7 | W
  1310.                      F | A
  1311. Examples:
  1312.  
  1313. 818594    SUB.M    5,B    ; B = B - 5    (48 bits)
  1314. 8186BD    SUB.B    14,D    ; D = D - 14     (8 bits)
  1315. ________________________________________________________________
  1316.  
  1317. Subtract Constant from Address Register
  1318.  
  1319.  
  1320.         18x    SUB.A    x+1,D0        ***
  1321.         1Cx    SUB.A    x+1,D1        ***
  1322.  
  1323. Examples:
  1324.  
  1325. 184    SUB    5,D0    ; D0 = D0 - 5    (20 bits)
  1326. 1C9    SUB    10,D1    ; D1 = D1 - 10    (20 bits)
  1327.  
  1328. ================================================================
  1329.         SWAP
  1330. ================================================================
  1331.  
  1332. SWAP Register with Register
  1333.  
  1334.         ppw    SWAP.f    s,d
  1335.  
  1336.                     pp | f        w | s d
  1337.                        --------    ---------
  1338.                     A8 | P        C | B A
  1339.                     A9 | WP     D | C B
  1340.                     AA | XS     E | A C
  1341.                     AB | X        F | C D
  1342.                     AC | S
  1343.                     AD | M
  1344.                     AE | B
  1345.                     AF | W
  1346.                     D  | A
  1347. Examples:
  1348.  
  1349. DF    SWAP.A    C,D    ; interchange values of C and D
  1350. ABC    SWAP.X    A,B    ; interchange low 3 nibbles of A and B
  1351. ________________________________________________________________
  1352.  
  1353. SWAP Register with Address Register
  1354.  
  1355.         13x    SWAP.A    s,Da        ***
  1356.         13z    SWAP.4    s,Da
  1357.  
  1358.                      x z | s Da
  1359.                     ------------
  1360.                      2 A | A D0
  1361.                      3 B | A D1
  1362.                      6 E | C D0
  1363.                      7 F | C D1
  1364. Examples:
  1365.  
  1366. 137    SWAP    C,D1    ; interchange low 20 bits of C and D1
  1367. 13A    SWAP.4    A,D0    ; interchange low 16 bits of A and D0
  1368. ________________________________________________________________
  1369.  
  1370. SWAP Register with Temporary Register
  1371.  
  1372.         12j    SWAP.W    A,Rn        ***
  1373.         12k    SWAP.W    C,Rn        ***
  1374.         81At2j    SWAP.f    A,Rn
  1375.         81At2k    SWAP.f    C,Rn
  1376.  
  1377.                      t | f       j k | Rn
  1378.                     -------   ----------
  1379.                      0 | P       0 8 | R0
  1380.                      1 | WP    1 9 | R1
  1381.                      2 | XS    2 A | R2
  1382.                      3 | X       3 B | R3
  1383.                      4 | S       4 C | R4
  1384.                      5 | M
  1385.                      6 | B
  1386.                      7 | W
  1387.                      F | A
  1388. Examples:
  1389.  
  1390. 121    SWAP    A,R1    ; interchange A with R1     (64 bits)
  1391. 12B    SWAP    C,R3    ; interchange C with R3     (64 bits)
  1392. 81AF24    SWAP.A    A,R4    ; interchange A with R4     (20 bits)
  1393. ________________________________________________________________
  1394.  
  1395. SWAP Register with PC
  1396.  
  1397.     These operations have the effect of saving the PC of
  1398.     the next instruction and transferring control to the
  1399.     address contained in the register.  This can be useful
  1400.     for implementing coroutines.
  1401.  
  1402.         81B6    SWAP.A    A,PC        ***
  1403.         81B7    SWAP.A    C,PC        ***
  1404. ________________________________________________________________
  1405.  
  1406. SWAP Register with Pointer Register
  1407.  
  1408.     Swap 4 bit P register value with the high order nibble
  1409.     of the specified field of register C.
  1410.  
  1411.  
  1412.         80Fx    SWAP.1    P,C,x        ***
  1413. Examples:
  1414.  
  1415. 80F0    SWAP    P,C,0    ; interchange P with low nibble of C
  1416. 80FF    SWAP    P,C,15    ; interchange P with high nibble of C
  1417. ________________________________________________________________
  1418.  
  1419. SWAP Register with Status Register
  1420.  
  1421.         0B    SWAP.X    C,ST        ***
  1422.  
  1423. ================================================================
  1424.  
  1425.